<template>
  <el-dropdown-item>
    <el-row :gutter="20">
      <el-col :span="8" :offset="8">
        <h3>订单管理系统</h3>
      </el-col>
      <el-col :span="3" :offset="5">
        <el-dropdown :hide-on-click="true" trigger="click">
          <span class="el-dropdown-link">
            <i class="iconfont">&#xe61b;</i>
            admin
            <i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>
              <div @click="changesPassWord">
                <i class="iconfont">&#xe60c;</i>
                修改密码
              </div>
            </el-dropdown-item>

            <el-dropdown-item>
              <div @click="modifyingData">
                <i class="iconfont">&#xe641;</i>
                修改资料
              </div>
            </el-dropdown-item>

            <el-dropdown-item>
              <div @click="Logout">
                <i class="iconfont">&#xe60e;</i>
                退出登录
              </div>
            </el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </el-col>
    </el-row>
    <change-password />
    <modifying-data />
  </el-dropdown-item>
</template>

<script>
import ChangePassword from './ChangePassword'
import modifyingData from './modifyingData'
export default {
  components: {
    ChangePassword,
    modifyingData
  },
  methods: {
    changesPassWord() {
      this.$store.commit('myCommon/changePassWord', true)
    },
    modifyingData() {
      this.$store.commit('myCommon/modifyingData', true)
    },
    Logout() {
      alert('退出登陆...')
    }
  }
}
</script>

<style lang='scss' scoped>
.el-dropdown-item {
  .el-row {
    padding: 0;
    margin: 0;
  }
}
</style>